package lab.relaxng.ws.util;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.logging.Logger;

public class LoggerOutputStream extends OutputStream {

	private Logger logger;
	public static StringBuilder schema = new StringBuilder();
	
	public LoggerOutputStream(String name) {
		logger = Logger.getLogger(name);
	}
	
	public LoggerOutputStream(File f) {
		this(f.getName());
	}
	
	@Override
	public void write(int arg0) throws IOException {
		schema.append((char)arg0);
		DBUtils.updateSchema(schema.toString());
		logger.info(schema.toString());
	}

	
	
}
